PLAYERS = [] def list_players(): if PLAYERS: print(PLAYERS) else: print("Roster is empty") def add_player(name): PLAYERS.append(name) print(PLAYERS) def change_player(name, new_name): if name in PLAYERS: current = PLAYERS.index(name) PLAYERS[current] = new_name else: print(name," Not in list") print(PLAYERS) def remove_player(name): current = PLAYERS.index(name) del PLAYERS[current] print(PLAYERS) menu_choice = 0 print("Welcome to the Player Roster") while menu_choice != 9: print("-------Menu-------") print("1. Show Player List") print("2. Add a name to the list") print("3. Remove a name from the list") print("4. Change an Name in the list") print("9. Exit Player Roster") menu_choice = int(input("Pick an item from the menu: ")) if menu_choice == 1: list_players() elif menu_choice == 2: name_inp = input("What is the new name: ") add_player(name_inp) elif menu_choice == 3: del_name = input("What name would you like to remove: ") remove_player(del_name) elif menu_choice == 4: old_name = input("What name would you like to change: ") new_name = input("What is the new name: ") change_player(old_name, new_name) print("Have a Good Day")